<?php


namespace App\Http\Controllers;


trait ApiResponse
{
    public function data($data)
    {
        return response()->json(
            [
                'code' => 200,
                'message' => "success",
                'data' => $data
            ]
        );
    }
    public function message_success($message)
    {
        return response()->json(
            [
                'code' => 200,
                'message' => $message,
            ]
        );
    }
    public function message_error($message)
    {
        return response()->json(
            [
                'code' => 500,
                'message' => $message,
            ]
        );
    }
}
